package demo_0711;

public class T10_0324 {
    public boolean isSymmetric(TreeNode root) {
        return isSymmetricChild(root.left,root.right);
    }
    private boolean isSymmetricChild(TreeNode left, TreeNode right) {
        if (left == null && right == null) return true;
        if (left == null || right == null) return false;
        if (left.val != right.val) return false;
        return isSymmetricChild(left.left,right.right) && isSymmetricChild(left.right,right.left);
    }
}
